import requests
from bs4 import BeautifulSoup

urls = [
    f'https://www.cnblogs.com/#p{url_id}'
    for url_id in range(1, 31)
]


def get_blog_response(url):
    # 博客园 有问题，不管url怎么变化，返回的永远是首页的数据
    blog_response = requests.get(url)
    return blog_response.text


def get_blog_links(html):
    soup = BeautifulSoup(html, 'html.parser')
    links = soup.find_all('a', class_='post-item-title')
    return [(link['href'], link.get_text()) for link in links]


if __name__ == '__main__':
    html3 = get_blog_response('https://www.cnblogs.com/#p3')
    print(html3)
